void main() {
  List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": false},
    {"count": 5, "price": 20.0, "selected": true}
  ];
  double totalPrice = 0;
  for (var item in carts) {
    if (item['selected'] == true) {
      totalPrice += item['count'] * item['price'];
    }
  }
  print(totalPrice);
  print(isAllSelected(carts));
}

bool isAllSelected(List carts) {
  for (var item in carts) {
    if (item['selected'] == false) {
      return false;
    }
  }
  return true;
}
